if (e.getKey() == e.KEY_ENTER) {
    var cond = {
        cond: textfield.getValue(),
        resId: null
    };

    if (this.getItem('grdDeviceResource').getSelectionModel().hasSelection()) {
        cond.resId = this.getItem('grdDeviceResource').getSelectionModel().getSelection()[0];
    }

    this.loadAllMaintainStore(cond);
}